Page({

  /**
   * 页面的初始数据
   */
  data: {
    bottomItms: [{
        img: '../../../images/my/fh.png',
        text: '回商城'
      },
      {
        img: '../../../images/my/hb.png',
        text: '我的海报'
      },
      {
        img: '../../../images/my/fx.png',
        text: '邀请返现'
      },
      {
        img: '../../../images/my/yx.png',
        text: '营销玩法'
      },
      {
        img: '../../../images/my/cp.png',
        text: '热销产品'
      }
    ],
    myPosterModal:false,
    bottomCurIndex:0
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function(options) {

  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function() {

  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function() {

  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function() {

  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function(options) {

  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function() {

  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function() {

  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function() {

  },
  back: function() {
    wx.navigateBack();
  },
  //提现页面
  toWithdrawal: function() {
    wx.navigateTo({
      url: '../withdrawal-money/index' // 指定页面的url
    });
  },
  // 去店铺粉丝
  toEarnFans: function() {
    wx.navigateTo({
      url: '../earn-fans/index',
    })
  },
  toEarnOrders: function() {
    wx.navigateTo({
      url: '../earn-orders/index',
    })
  },
  toEarnDetail: function() {
    wx.navigateTo({
      url: '../earn-detail/index',
    })
  },
  bottomSelect: function(e) {
    var that = this;
    var index = e.currentTarget.dataset.index;
    that.setData({
      bottomCurIndex:index
    })
    switch (index) {
      case 0:
        wx.switchTab({
          url: '/pages/main-home/main-home'
        })
        break;
      case 1:
        that.setData({
          myPosterModal:true
        })
        console.log(this.data.myPosterModal)
        break;
      case 2:
        that.setData({
          myPosterModal: true
        })
        break;
      case 3:
        that.hiddenModels()
        break;
      case 4:
        that.hiddenModels()
        break;
    }
  },
  hiddenModels:function(){
    this.setData({
      myPosterModal: false
    })
  }

})